package com.atguigu.cloud.config;/**
 * @Auter zzh
 * @Date 2024/11/17
 */

import com.baomidou.mybatisplus.annotation.DbType;
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import tk.mybatis.spring.annotation.MapperScan;

/**
 * @projectName: keshe
 * @package: com.atguigu.cloud.config
 * @className: MpConfig
 * @author: Eric
 * @description: TODO
 * @date: 2024/11/17 11:47
 * @version: 1.0
 */
@Configuration
//扫描mapper接口所在的包
@MapperScan("com.atguigu.cloud.mapper")
public class MpConfig {
    @Bean
    public MybatisPlusInterceptor mInterceptor() {
        MybatisPlusInterceptor mpInterceptor = new MybatisPlusInterceptor();
        mpInterceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL));
        return mpInterceptor;
    }
}
